how to write select statement in jdbc program